package com.rzx.mybackend.enums;

import lombok.Data;

/**
 * MerchandiseOrderStatus
 *
 * @author renzhexian
 * @date 2025/8/14
 */

public enum MerchandiseOrderStatus {

    UNPAID(0, "待支付"),
    PAID(1, "已支付"),
    DELIVERED(2, "已发货"),
    COMPLETED(3, "已完成"),
    CANCELED(4, "已取消");

    private final int code;
    private final String message;

    MerchandiseOrderStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(int code) {
        for (MerchandiseOrderStatus value : MerchandiseOrderStatus.values()) {
            if (value.code == code) {
                return value.message;
            }
        }
        return null;
    }

}
